<div id="thread_all">
<?php foreach($thread->result() as $row){
	echo '<h3>' . $row->name . '</h3>' . "\n";
}
if ($count == '0') {
	echo '<div class="error">No designs in this thread!</div>';
}
$i = $count+1; 
echo '<ul>' . "\n";
foreach($query->result() as $row) {
$i--;
echo '<li>' . anchor('designs/thread/'. $this->uri->segment(3) . '/' . $i, img('designs/small_' . $row->image)) . '</li>' . "\n";
} ?>
</ul>
</div>